from selenium.webdriver.common.by import By

from base.app_base_page import AppBasePage


class  PageShopping(AppBasePage):

    def __init__(self,driver):
        super().__init__(driver)
        self.ye=([(28, 366), (517, 855)])
        # 点击加入购物车
        self.e=By.XPATH,'//android.widget.TextView[@resource-id="com.tpshop.malls:id/add_cart_tv"]'
        # 点击确定
        self.f=By.XPATH,'//android.widget.TextView[@resource-id="com.tpshop.malls:id/confirm_tv"]'
        # # 点击购物车
        self.g=By.XPATH,'//android.widget.ImageView[@resource-id="com.tpshop.malls:id/bottom_cart_img"]'
        # # 点击立即购买
        # self.h=By.XPATH,'//android.widget.TextView[@resource-id="com.tpshop.malls:id/buy_tv"]'
        # # 点击提交订单
        # self.i=By.XPATH,'//android.widget.TextView[@resource-id="com.tpshop.malls:id/submit_tv"]'
        # # 点击支付
        # self.j=By.XPATH,'//android.widget.Button[@resource-id="com.tpshop.malls:id/pay_btn"]'
        # # 输入支付密码
        # self.k=By.ID,'com.tpshop.malls:id/pwd_et'
        # # 点击确定
        # self.l=By.XPATH,'//android.widget.TextView[@resource-id="com.tpshop.malls:id/sure_tv"]'
        # # 获取订单确认成功
    def app_pageshopping(self):
        self.driver.tap(self.ye)
        self.app_base_click(self.e)
        self.app_base_click(self.f)
        self.app_base_click(self.g)